export default{
  methods: {
    goDetail(id){
      const { href } = this.$router.resolve({
        path: `/detail?id=${id}`
      });
      window.open(href, '_blank');
    },
    goMore(type){
      this.$router.push(`/more/${type}`)
    },
    addCart(item){
      item.num = 1;
      item.isSelected = true;
      var commodity = JSON.parse(JSON.stringify(item))
      this.$store.commit('addCart',commodity)
    },
    goCart(){
      this.$router.push(`/cart`)
    },
    back(){
      this.$router.push('/home')
    },
  }  
}